package janelas;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.ListSelectionModel;
import outros.GeradorRelatorio;
import outros.Util;
import persistencia.DAOPatrimonio;
import persistencia.DAOSetor;
import persistencia.DAOTransferencia;
import principal.Principal;
import transporte.TOGenerico;
import transporte.TOPai;
import transporte.TOPatrimonio;
import transporte.TOSetor;
import transporte.TOTransferencia;

public class Transferencia extends javax.swing.JInternalFrame implements JanelaPai {
    private ArrayList<TOSetor> setor = new ArrayList();
    private DAOSetor daoSetor = new DAOSetor();
    private ArrayList<TOGenerico> orgao = new ArrayList();
    private DAOPatrimonio daoPatrimonio = new DAOPatrimonio();
    private ArrayList<TOPatrimonio> patrimonio = new ArrayList();
    private TOPatrimonio toPatrimonio = new TOPatrimonio();
    private DAOTransferencia daoTransferencia = new DAOTransferencia();
    //
    private GeradorRelatorio gr = new GeradorRelatorio();
    private TOPatrimonio[] escolhidos = new TOPatrimonio[]{
                                        new TOPatrimonio(),new TOPatrimonio(),
                                        new TOPatrimonio(),new TOPatrimonio(),
                                        new TOPatrimonio(),new TOPatrimonio(),
                                        new TOPatrimonio(),new TOPatrimonio()};
    private Util util = new Util();
    private int setorEscolhido = -1;

    public Transferencia() {
        for (int i=0;i<escolhidos.length;i+=1) {
            escolhidos[i].setNumero(-1);
        }
        initComponents();
        tabela.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-getWidth())/2, (int)((screenSize.height-getHeight())/3), getWidth(), getHeight());
        preencherComboBox();
    }

    public void reiniciar() {
        preencherComboBox();
        limparCampos(false);
    }

    private void limparCampos(boolean novo) {
        try {
            for (int i=0;i<escolhidos.length;i+=1) {
                tabela.setValueAt("", i, 0);
                escolhidos[i].setNumero(-1);
            }
            if (!novo) {
                camSetorDe.setSelectedIndex(0);
                camSetorPara.setSelectedIndex(0);
                camPatrimonio.requestFocus();
            }
        } catch (Exception e) {}
    }

    private void preencherComboBox() {
        setor = daoSetor.selecionar("");        
        camSetorDe.removeAllItems();
        camSetorPara.removeAllItems();
        for (int i=0;i<setor.size();i+=1) {
            camSetorDe.addItem(setor.get(i).getNome());
            camSetorPara.addItem(setor.get(i).getNome());
        }
        atualizarPatrimonio();
    }

    private void atualizarPatrimonio() {
        int novoValor = 0;
        try {
            novoValor = setor.get(camSetorDe.getSelectedIndex()).getNumero();
        } catch (Exception e) {}
        if (novoValor!=setorEscolhido) {
            limparCampos(true);
        }
        try {
            patrimonio = daoPatrimonio.selecionarPorSetor(setor.get(camSetorDe.getSelectedIndex()).getNumero());
            camPatrimonio.removeAllItems();
            for (int i=0;i<patrimonio.size();i+=1) {
                String numeracao = Integer.toString(patrimonio.get(i).getArea())+"-"+
                                   Integer.toString(patrimonio.get(i).getGrupo())+"-"+
                                   Integer.toString(patrimonio.get(i).getSubgrupo())+"-"+
                                   Integer.toString(patrimonio.get(i).getNumero())+" : "+
                                   patrimonio.get(i).getNome();
                camPatrimonio.addItem(numeracao);
            }
            camPatrimonioNum.setText(Integer.toString(patrimonio.get(0).getNumero()));
        } catch (Exception e) {}
        setorEscolhido = novoValor;
    }

    private String[] getParametros() {
        String[] parametros = new String[5];
        Date data =  new Date();
        Locale local = new Locale("pt","BR");
        DateFormat dateFormat = new SimpleDateFormat("'Goiânia,' dd 'de' MMMM 'de' yyyy'.'",local);
        parametros[0] = dateFormat.format(data);
        parametros[1] = setor.get(camSetorDe.getSelectedIndex()).getNome();
        parametros[2] = daoSetor.getAtributo(setor.get(camSetorDe.getSelectedIndex()).getNumero(), "chefe");
        parametros[3] = setor.get(camSetorPara.getSelectedIndex()).getNome();
        parametros[4] = daoSetor.getAtributo(setor.get(camSetorPara.getSelectedIndex()).getNumero(), "chefe");
        return parametros;
    }

    private void preencherPatrimonio() {
        toPatrimonio.setOrgao(patrimonio.get(camPatrimonio.getSelectedIndex()).getOrgao());
        toPatrimonio.setArea(patrimonio.get(camPatrimonio.getSelectedIndex()).getArea());
        toPatrimonio.setGrupo(patrimonio.get(camPatrimonio.getSelectedIndex()).getGrupo());
        toPatrimonio.setSubgrupo(patrimonio.get(camPatrimonio.getSelectedIndex()).getSubgrupo());
        toPatrimonio.setNumero(patrimonio.get(camPatrimonio.getSelectedIndex()).getNumero());
        toPatrimonio.setNome(patrimonio.get(camPatrimonio.getSelectedIndex()).getNome());
        toPatrimonio.setGarantia(patrimonio.get(camPatrimonio.getSelectedIndex()).getGarantia());
        toPatrimonio.setEmprestimo(patrimonio.get(camPatrimonio.getSelectedIndex()).getEmprestimo());
    }

    private boolean jaEstaNaTabela(int[] dados) {
        for (int i=0;i<escolhidos.length;i+=1) {
            if (escolhidos[i].getNumero()!=-1) {
                if (escolhidos[i].getOrgao()==dados[0] && escolhidos[i].getArea()==dados[1] &&
                    escolhidos[i].getGrupo()==dados[2] && escolhidos[i].getSubgrupo()==dados[3] &&
                    escolhidos[i].getNumero()==dados[4]) {
                    return true;
                }
            }
        }
        return false;
    }

    private void adicionarPatrimonio() {
        preencherPatrimonio();
        if (!jaEstaNaTabela(new int[]{toPatrimonio.getOrgao(), toPatrimonio.getArea(),
                                     toPatrimonio.getGrupo(), toPatrimonio.getSubgrupo(),
                                     toPatrimonio.getNumero()})) {
            if (toPatrimonio.getGarantia()==0 && toPatrimonio.getEmprestimo()==0) {
                for (int i=0;i<escolhidos.length;i+=1) {
                    if (escolhidos[i].getNumero()==-1) {
                        escolhidos[i].setOrgao(toPatrimonio.getOrgao());
                        escolhidos[i].setArea(toPatrimonio.getArea());
                        escolhidos[i].setGrupo(toPatrimonio.getGrupo());
                        escolhidos[i].setSubgrupo(toPatrimonio.getSubgrupo());
                        escolhidos[i].setNumero(toPatrimonio.getNumero());
                        escolhidos[i].setNome(toPatrimonio.getNome());
                        String numeracao = Integer.toString(toPatrimonio.getArea())+"-"+
                                           Integer.toString(toPatrimonio.getGrupo())+"-"+
                                           Integer.toString(toPatrimonio.getSubgrupo())+"-"+
                                           Integer.toString(toPatrimonio.getNumero())+" : "+
                                           toPatrimonio.getNome();
                        tabela.setValueAt(numeracao, i, 0);
                        break;
                    } else if (i==escolhidos.length-1) {
                        JOptionPane.showMessageDialog(null, "Todos os espaços para patrimônio estão cheios.");
                    }
                }
            } else {
                JOptionPane.showMessageDialog(null, "O patrimônio está na garantia ou emprestado.", "AVISO", JOptionPane.WARNING_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(null, "O patrimônio já está na lista.", "AVISO", JOptionPane.WARNING_MESSAGE);
        }
    }

    private void removerPatrimonio(int linha) {
        tabela.setValueAt("", linha, 0);
        escolhidos[linha].setNumero(-1);
    }

    private ArrayList<TOTransferencia> getTransferencias() {
        ArrayList<TOTransferencia> trans = new ArrayList();
        TOTransferencia t = null;
        for (int i=0;i<escolhidos.length;i+=1) {
            if (escolhidos[i].getNumero()!=-1) {
                t = new TOTransferencia();
                t.setPatrimonio(escolhidos[i]);
                t.setData(util.getData());
                t.setHora(util.getHora());
                t.setUsuario(Principal.getUsuarioLogado().getNumero());
                t.setSetorOrigem(setor.get(camSetorDe.getSelectedIndex()).getNumero());
                t.setSetorDestino(setor.get(camSetorPara.getSelectedIndex()).getNumero());
                trans.add(t);
            }
        }
        return trans;
    }

    private boolean setarCombo(String n, String nome, ArrayList lista, JComboBox campo) {
        int num = Integer.parseInt(n);
        for (int i=0;i<lista.size();i+=1) {
            if (((TOPai)lista.get(i)).getNumero()==num) {
                campo.setSelectedIndex(i);
                //proxCampo.requestFocus();
                return true;
            }
        }
        JOptionPane.showMessageDialog(null, nome+" inexistente.");
        return false;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        botAdicionar = new javax.swing.JButton();
        jLabel30 = new javax.swing.JLabel();
        camSetorDe = new javax.swing.JComboBox();
        camPatrimonio = new javax.swing.JComboBox();
        camPatrimonioNum = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        camSetorPara = new javax.swing.JComboBox();
        jLabel31 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabela = new javax.swing.JTable();
        botBuscar2 = new javax.swing.JButton();
        botLimpar = new javax.swing.JButton();

        setClosable(true);
        setTitle("Movimentar Bem - Transferência");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Buscar Patrimônio", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        jLabel29.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel29.setText("Patrimônio");

        botAdicionar.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botAdicionar.setText("Adicionar");
        botAdicionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botAdicionarActionPerformed(evt);
            }
        });

        jLabel30.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel30.setText("Setor de Origem");

        camSetorDe.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camSetorDe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camSetorDeActionPerformed(evt);
            }
        });

        camPatrimonio.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camPatrimonio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camPatrimonioActionPerformed(evt);
            }
        });

        camPatrimonioNum.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camPatrimonioNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camPatrimonioNumActionPerformed(evt);
            }
        });
        camPatrimonioNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camPatrimonioNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camPatrimonioNumFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel30)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(camSetorDe, 0, 490, Short.MAX_VALUE))
                    .addComponent(jLabel29)
                    .addComponent(botAdicionar, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(camPatrimonioNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(camPatrimonio, 0, 548, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(camSetorDe, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(camPatrimonio, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camPatrimonioNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botAdicionar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Movimentação", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        camSetorPara.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel31.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel31.setText("Setor de Destino");

        tabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null},
                {null},
                {null},
                {null},
                {null},
                {null},
                {null},
                {null}
            },
            new String [] {
                "Bens"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabela.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tabelaKeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(tabela);
        tabela.getColumnModel().getColumn(0).setResizable(false);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel31)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(camSetorPara, 0, 490, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(camSetorPara, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        botBuscar2.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botBuscar2.setText("OK");
        botBuscar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botBuscar2ActionPerformed(evt);
            }
        });

        botLimpar.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botLimpar.setText("Limpar Campos");
        botLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botLimparActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(botLimpar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botBuscar2)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botBuscar2)
                    .addComponent(botLimpar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void botAdicionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botAdicionarActionPerformed
        adicionarPatrimonio();
        camPatrimonioNum.requestFocus();
}//GEN-LAST:event_botAdicionarActionPerformed

    private void botBuscar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botBuscar2ActionPerformed
        ArrayList<TOTransferencia> t = getTransferencias();
        if (t.size()>0) {
            if (JOptionPane.showConfirmDialog(null, "Confirma a transferência?")==0) {
                daoTransferencia.criarRegistro(getTransferencias());
                gr.geraTermoTransferencia(getParametros(), escolhidos);
                limparCampos(false);
            }
        } else {
            JOptionPane.showMessageDialog(null, "Selecione pelo menos um item para ser transferido.");
        }
    }//GEN-LAST:event_botBuscar2ActionPerformed

    private void tabelaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabelaKeyReleased
        if (evt.getKeyCode()==KeyEvent.VK_DELETE) {
            removerPatrimonio(tabela.getSelectedRow());
        }
    }//GEN-LAST:event_tabelaKeyReleased

    private void botLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botLimparActionPerformed
        limparCampos(false);
}//GEN-LAST:event_botLimparActionPerformed

    private void camSetorDeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camSetorDeActionPerformed
        atualizarPatrimonio();
    }//GEN-LAST:event_camSetorDeActionPerformed

    private void camPatrimonioNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camPatrimonioNumActionPerformed
        botAdicionar.requestFocus();
}//GEN-LAST:event_camPatrimonioNumActionPerformed

    private void camPatrimonioNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camPatrimonioNumFocusGained
        camPatrimonioNum.selectAll();
}//GEN-LAST:event_camPatrimonioNumFocusGained

    private void camPatrimonioNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camPatrimonioNumFocusLost
        if (!setarCombo(camPatrimonioNum.getText(), "Patrimônio", patrimonio, camPatrimonio)) {
            camPatrimonio.setSelectedIndex(0);
            camPatrimonioNum.setText(Integer.toString(patrimonio.get(0).getNumero()));
            camPatrimonioNum.requestFocus();
        }
}//GEN-LAST:event_camPatrimonioNumFocusLost

    private void camPatrimonioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camPatrimonioActionPerformed
        camPatrimonioNum.setText(Integer.toString(patrimonio.get(camPatrimonio.getSelectedIndex()).getNumero()));
    }//GEN-LAST:event_camPatrimonioActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botAdicionar;
    private javax.swing.JButton botBuscar2;
    private javax.swing.JButton botLimpar;
    private javax.swing.JComboBox camPatrimonio;
    private javax.swing.JTextField camPatrimonioNum;
    private javax.swing.JComboBox camSetorDe;
    private javax.swing.JComboBox camSetorPara;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tabela;
    // End of variables declaration//GEN-END:variables

}
